// pages/detail/detail.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    goods:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(query){
    const goods_id = query.goods_id;

    wx.request({
      url: 'https://api-hmugo-web.itheima.net/api/public/v1/goods/detail',
      data:{
        goods_id:goods_id
      },
      success:res=>{
        console.log(res)
        const goods = res.data.message;
        this.setData({
            goods: goods
        })
      }
    })
  }
})